/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;
import static java.lang.Math.pow;

/**
 * <p>Project: jse2204 - MathDemo
 * <p>Powered by webrx On 2022-08-31 17:33:49
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class MathDemo {
    public static void main(String[] args) {
        System.out.println(pow(2,2));
        //System.out.println(Math.pow(2,3));
        //System.out.println(Math.pow(19,2));
        System.out.println(Math.round(.5));
        System.out.println(Math.PI);
        System.out.println(Math.random());
        System.out.println(Math.max(10,20));
        System.out.println(Math.min(10,20));
        System.out.println(Math.abs(-6));
        System.out.println(Math.abs(6));

        //ceil() 小数必须入整
        System.out.println((int)Math.ceil(1.0));
        System.out.println((int)Math.ceil(1.1));
        System.out.println((int)Math.ceil(1.5));
        System.out.println((int)Math.ceil(1.9));

        //舍掉小数
        System.out.println((int)Math.floor(1.0));
        System.out.println((int)Math.floor(1.1));
        System.out.println((int)Math.floor(1.5));
        System.out.println((int)Math.floor(1.9));

    }
}
